/*
 * p222.cpp
 *
 *  Created on: 2013-7-28
 *      Author: zy
 */
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
long long f[11][1030];
int n, k;
int num1(int s)//s二进制中1的个数
{
	int ans = 0;
	while (s > 0)
	{
		ans += s % 2;
		s /= 2;
	}
	return ans;
}
int main()
{
	scanf("%d%d", &n, &k);
	memset(f, 0, sizeof(f));
	if (k > n)
	{
		puts("0");
		return 0;
	}
	long long ans = 0;
	f[0][0]=1;
	for (int i = 1; i <= n; i++)
	{
		for (int s = 0; s < (1 << n); s++)
		{
			int b=num1(s);
			if ( b > i)
				continue;//前i行最多放i个
			f[i][s] += f[i - 1][s];//未添加棋子
			for (int j = 1; j <= n; j++)
				if (((1 << (j - 1)) & s)>0)//s的第j位为1
					f[i][s] += f[i - 1][s - (1 << (j - 1))];
			if (b == k && i == n)
				ans += f[i][s];
		}
	}
	cout << ans << endl;
	return 0;
}
